/*
 * @Author: your name
 * @Date: 2021-02-06 19:40:33
 * @LastEditTime: 2021-09-15 11:11:45
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \sass\store\index.js
 */
// store/index.js
import Vue from "vue";
import Vuex from "vuex";
import modules from "./modules";
Vue.use(Vuex);

const globalStore = {
    state: {
        token: "", // 用户凭证 Token
        indexNav: 0, // 菜单栏索引
    },
    mutations: {
        //统一设置state
        SET_STATE(state, data) {
            Object.assign(state, data);
        },

    },
    actions: {

    },
    getters: {
        token: (state) => state.token,
        indexNav: (state) => state.indexNav,
        globalColor: (state) => state.globalColor,
        globalColorTow: (state) => state.globalColorTow,
    },
};

const store = new Vuex.Store({
    modules,
    ...globalStore,
});

export default store;